package com.example.demo02.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo02.entity.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * (Products)表数据库访问层
 *
 * @author makejava
 * @since 2024-09-01 20:15:30
 */
@Mapper
public interface ProductMapper extends BaseMapper<Product> {
    @Update("UPDATE product SET stock_quantity = stock_quantity + #{quantity} WHERE product_id = #{productId}")
    int updateByIdQu(@Param("productId") Integer productId, @Param("quantity") int quantity);
}

